/* GUI CONVERTED from rcrp03.p (converter v1.76) Fri May  3 13:21:34 2002 */
/* rcrp03.p - Release Management Customer Schedules                           */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                        */
/* All rights reserved worldwide.  This is an unpublished work.               */
/* $Revision: 1.8.1.6 $                                                       */
/*V8:ConvertMode=FullGUIReport                                                */
/* REVISION: 7.0    LAST MODIFIED: 01/29/92           BY: WUG *F110*          */
/* REVISION: 7.0    LAST MODIFIED: 03/19/92           BY: WUG *F312*          */
/* REVISION: 7.0    LAST MODIFIED: 03/26/92           BY: WUG *F323*          */
/* REVISION: 7.3    LAST MODIFIED: 10/13/92           BY: WUG *G462*          */
/*                                 08/27/94           BY: BCM *GL61*          */
/* REVISION: 7.3    LAST MODIFIED: 07/22/96   BY: *G29C* Ajit Deodhar         */
/* REVISION: 8.5    LAST MODIFIED: 06/11/97   BY: *J1SX* Aruna Patil          */
/* REVISION: 8.6    LAST MODIFIED: 10/07/97           BY: bvm  *K0MK*         */
/* REVISION: 8.6E   LAST MODIFIED: 02/23/98   BY: *L007* A. Rahane            */
/* REVISION: 8.6E   LAST MODIFIED: 10/04/98   BY: *J314* Alfred Tan           */
/* REVISION: 9.1    LAST MODIFIED: 03/24/00   BY: *N08T* Annasaheb Rahane     */
/* REVISION: 9.1    LAST MODIFIED: 08/12/00   BY: *N0KP* Mark Brown           */
/* REVISION: 9.1    LAST MODIFIED: 09/04/00   BY: *N0RB* Mudit Mehta          */
/* Old ECO marker removed, but no ECO header exists *F0PN*                    */
/* Revision: 1.8.1.4     BY: Jean Miller        DATE: 03/22/01  ECO: *P008*   */
/* Revision: 1.8.1.5     BY: Manisha Sawant     DATE: 08/20/01  ECO: *P01N*   */
/* $Revision: 1.8.1.6 $    BY: Katie Hilbert      DATE: 04/15/02  ECO: *P03J*   */
/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/

/* SCHEDULE AUTHORIZATION REPORT */


/*GUI global preprocessor directive settings */
&GLOBAL-DEFINE PP_PGM_RP TRUE
&GLOBAL-DEFINE PP_ENV_GUI TRUE


/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

{mfdtitle.i "2+ "}

{rcrpvar.i}
define variable schtype       like sch_type initial 1 no-undo.
define variable date_from     as date label "Created" no-undo.
define variable date_to       as date label {t001.i} no-undo.
define variable sortoption    as integer label "Sort Option"
                              format "9" initial 1 no-undo.
define variable sortextoption as character extent 2 format "x(66)" no-undo.
define variable hifab_rlse_id like sch_rlse_id no-undo.
define variable hifab_qty     like sch_fab_qty no-undo.
define variable hifab_strt    like sch_fab_strt no-undo.
define variable hifab_end     like sch_fab_end no-undo.
define variable hiraw_rlse_id like sch_rlse_id no-undo.
define variable hiraw_qty     like sch_raw_qty no-undo.
define variable hiraw_strt    like sch_raw_strt no-undo.
define variable hiraw_end     like sch_raw_end no-undo.

assign
   sortextoption[1] = "1 - " + getTermLabel("BY_SHIP-FROM",12)      + "," +
                               getTermLabel("CUSTOMER",4)           + "," +
                               getTermLabel("SHIP-TO",7)            + "," +
                               getTermLabel("ORDER",5)              + "," +
                               getTermLabel("DOCK",4)               + "," +
                               getTermLabel("ITEM",4)               + "," +
                               getTermLabel("PURCHASE_ORDER",2)     + "," +
                               getTermLabel("CUSTOMER_REFERENCE",8) + "," +
                               getTermLabel("MODEL_YEAR",8).

   sortextoption[2] = "2 - " + getTermLabel("BY_SHIP-FROM",12)      + "," +
                               getTermLabel("ITEM",4)               + "," +
                               getTermLabel("CUSTOMER",4)           + "," +
                               getTermLabel("SHIP-TO",7)            + "," +
                               getTermLabel("ORDER",5)              + "," +
                               getTermLabel("DOCK",4)               + "," +
                               getTermLabel("PURCHASE_ORDER",2)     + "," +
                               getTermLabel("CUSTOMER_REFERENCE",8) + "," +
                               getTermLabel("MODEL_YEAR",8).



/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A

FORM /*GUI*/ 
   
 RECT-FRAME       AT ROW 1.4 COLUMN 1.25
 RECT-FRAME-LABEL AT ROW 1   COLUMN 3 NO-LABEL
 SKIP(.1)  /*GUI*/
shipfrom_from        colon 15 label "Ship-From"
   shipfrom_to          colon 45 label {t001.i}
   cust_from            colon 15
   cust_to              colon 45 label {t001.i}
   shipto_from          colon 15
   shipto_to            colon 45 label {t001.i}
   dock_from            colon 15
   dock_to              colon 45 label {t001.i}
   part_from            colon 15
   part_to              colon 45 label {t001.i}
   po_from              colon 15 format "x(22)"
   po_to                colon 45 label {t001.i} format "x(22)"
   custref_from         colon 15 format "x(22)"
   custref_to           colon 45 label {t001.i} format "x(22)"
   modelyr_from         colon 15
   modelyr_to           colon 45 label {t001.i}
   order_from           colon 15
   order_to             colon 45 label {t001.i}
   date_from            colon 15
   date_to              colon 45 label {t001.i}
   skip(1)
   sortoption           colon 15
   skip
   sortextoption[1]     at 10 no-label
   sortextoption[2]     at 10 no-label
   skip(1)
 SKIP(.4)  /*GUI*/
with frame a side-labels width 80 attr-space NO-BOX THREE-D /*GUI*/.

 DEFINE VARIABLE F-a-title AS CHARACTER.
 F-a-title = &IF (DEFINED(SELECTION_CRITERIA) = 0)
  &THEN " Selection Criteria "
  &ELSE {&SELECTION_CRITERIA}
  &ENDIF .
 RECT-FRAME-LABEL:SCREEN-VALUE in frame a = F-a-title.
 RECT-FRAME-LABEL:WIDTH-PIXELS in frame a =
  FONT-TABLE:GET-TEXT-WIDTH-PIXELS(
  RECT-FRAME-LABEL:SCREEN-VALUE in frame a + " ", RECT-FRAME-LABEL:FONT).
 RECT-FRAME:HEIGHT-PIXELS in frame a =
  FRAME a:HEIGHT-PIXELS - RECT-FRAME:Y in frame a - 2.
 RECT-FRAME:WIDTH-CHARS IN FRAME a = FRAME a:WIDTH-CHARS - .5. /*GUI*/

/*GUI preprocessor Frame A undefine */
&UNDEFINE PP_FRAME_NAME



/* SET EXTERNAL LABELS */
setFrameLabels(frame a:handle).

{wbrp01.i}

/*GUI*/ {mfguirpa.i true "printer" 132 " " " " " "  }

/*GUI repeat  with frame a: */
/*GUI*/ procedure p-enable-ui:


   display
      sortextoption
   with frame a.

   if shipfrom_to = hi_char then shipfrom_to = "".
   if cust_to     = hi_char then cust_to     = "".
   if shipto_to   = hi_char then shipto_to   = "".
   if dock_to     = hi_char then dock_to     = "".
   if part_to     = hi_char then part_to     = "".
   if po_to       = hi_char then po_to       = "".
   if custref_to  = hi_char then custref_to  = "".
   if modelyr_to  = hi_char then modelyr_to  = "".
   if order_to    = hi_char then order_to    = "".

   if c-application-mode <> "WEB" then
   
run p-action-fields (input "display").
run p-action-fields (input "enable").
end procedure. /* p-enable-ui, replacement of Data-Entry GUI*/

/*GUI*/ procedure p-report-quote:


   {wbrp06.i &command = update &fields = "  shipfrom_from shipfrom_to
       cust_from cust_to shipto_from shipto_to dock_from dock_to
       part_from part_to po_from po_to custref_from custref_to modelyr_from
       modelyr_to order_from order_to date_from date_to sortoption" &frm = "a"}

   if (c-application-mode <> "WEB") or
      (c-application-mode = "WEB" and
      (c-web-request begins "DATA"))
   then do:

      bcdparm = "".
      {mfquoter.i shipfrom_from}
      {mfquoter.i shipfrom_to }
      {mfquoter.i cust_from   }
      {mfquoter.i cust_to     }
      {mfquoter.i shipto_from }
      {mfquoter.i shipto_to   }
      {mfquoter.i dock_from   }
      {mfquoter.i dock_to     }
      {mfquoter.i part_from   }
      {mfquoter.i part_to     }
      {mfquoter.i po_from     }
      {mfquoter.i po_to       }
      {mfquoter.i custref_from }
      {mfquoter.i custref_to  }
      {mfquoter.i modelyr_from}
      {mfquoter.i modelyr_to  }
      {mfquoter.i order_from  }
      {mfquoter.i order_to    }
      {mfquoter.i date_from   }
      {mfquoter.i date_to     }
      {mfquoter.i sortoption  }

      if shipfrom_to = "" then shipfrom_to = hi_char.
      if cust_to     = "" then cust_to     = hi_char.
      if shipto_to   = "" then shipto_to   = hi_char.
      if dock_to     = "" then dock_to     = hi_char.
      if part_to     = "" then part_to     = hi_char.
      if po_to       = "" then po_to       = hi_char.
      if custref_to  = "" then custref_to  = hi_char.
      if modelyr_to  = "" then modelyr_to  = hi_char.
      if order_to    = "" then order_to    = hi_char.

   end.

   /* OUTPUT DESTINATION SELECTION */
   
/*GUI*/ end procedure. /* p-report-quote */
/*GUI - Field Trigger Section */

/*GUI MFSELxxx removed*/
/*GUI*/ procedure p-report:
/*GUI*/   {gpprtrpa.i "printer" 132 " " " " " " " " }
/*GUI*/   mainloop: do on error undo, return error on endkey undo, return error:




   {mfphead.i}

   if sortoption = 1 then do:

      for each scx_ref no-lock
         where scx_type = 1
           and scx_shipfrom >= shipfrom_from and scx_shipfrom <= shipfrom_to
           and scx_shipto >= shipto_from and scx_shipto <= shipto_to
           and scx_part >= part_from and scx_part <= part_to
           and scx_po >= po_from and scx_po <= po_to
           and scx_custref >= custref_from and scx_custref <= custref_to
           and scx_modelyr >= modelyr_from and scx_modelyr <= modelyr_to
           and scx_order >= order_from and scx_order <= order_to,
          each sod_det no-lock
         where sod_nbr = scx_order and sod_line = scx_line
           and sod_dock >= dock_from and sod_dock <= dock_to,
          each so_mstr no-lock
         where so_nbr = sod_nbr
           and so_cust >= cust_from and so_cust <= cust_to,
          each sch_mstr no-lock
         where sch_type = schtype
           and sch_nbr = sod_nbr
           and sch_line = sod_line
           and (sch_cr_date >= date_from or date_from = ?)
           and (sch_cr_date <= date_to or date_to = ?)
      break by scx_shipfrom by so_cust by scx_shipto by scx_order
            by sod_dock by sod_part by sod_contr_id
            by scx_custref by scx_modelyr by sch_rlse_id
      with frame f-a:

         setFrameLabels(frame f-a:handle).   /* SET EXTERNAL LABELS */

         {rcrp03.i}

         
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/


      end.

   end.

   else
   if sortoption = 2 then do:

      for each scx_ref no-lock
         where scx_type = 1
           and scx_shipfrom >= shipfrom_from and scx_shipfrom <= shipfrom_to
           and scx_shipto >= shipto_from and scx_shipto <= shipto_to
           and scx_part >= part_from and scx_part <= part_to
           and scx_po >= po_from and scx_po <= po_to
           and scx_custref >= custref_from and scx_custref <= custref_to
           and scx_modelyr >= modelyr_from and scx_modelyr <= modelyr_to
           and scx_order >= order_from and scx_order <= order_to,
          each sod_det no-lock
         where sod_nbr = scx_order and sod_line = scx_line
           and sod_dock >= dock_from and sod_dock <= dock_to,
          each so_mstr no-lock
         where so_nbr = sod_nbr
           and so_cust >= cust_from and so_cust <= cust_to,
          each sch_mstr no-lock
         where sch_type = schtype
           and sch_nbr = sod_nbr
           and sch_line = sod_line
           and (sch_cr_date >= date_from or date_from = ?)
           and (sch_cr_date <= date_to or date_to = ?)
      break by scx_shipfrom by sod_part by so_cust by scx_shipto
            by scx_order by sod_dock by sod_contr_id
            by scx_custref by scx_modelyr by sch_rlse_id
      with frame f-b:

         setFrameLabels(frame f-b:handle).      /* SET EXTERNAL LABELS */

         {rcrp03.i}

         
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/


      end.

   end.

   /* REPORT TRAILER */
   
/*GUI*/ {mfguitrl.i} /*Replace mfrtrail*/

/*GUI*/ {mfgrptrm.i} /*Report-to-Window*/


end.

{wbrp04.i &frame-spec = a}

/*GUI*/ end procedure. /*p-report*/
/*GUI*/ {mfguirpb.i &flds=" shipfrom_from shipfrom_to cust_from cust_to shipto_from shipto_to dock_from dock_to part_from part_to po_from po_to custref_from custref_to modelyr_from modelyr_to order_from order_to date_from date_to sortoption "} /*Drive the Report*/
